package com.winit.deploy.task.androidTask;

import com.winit.core.task.Task;
import com.winit.deploy.server.WinitAndroidServer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 安卓回滚
 * Created by wangjian on 16/10/17.
 */
public class AndroidRollBackTask extends Task {

    private static Logger logger = LoggerFactory.getLogger(AndroidRollBackTask.class);

    private WinitAndroidServer server;

    public AndroidRollBackTask(String taskId, Integer expireTime, WinitAndroidServer server) {
        super(taskId, expireTime);
        this.server = server;
    }

    @Override
    public TaskStatus call() throws Exception {
        logger.info("com.winit.deploy.task.androidTask.AndroidRollBackTask#call start taskId="+this.taskId);
        this.server.doRollBack("apache");
        logger.info("com.winit.deploy.task.androidTask.AndroidRollBackTask#call end taskId="+this.taskId);
        return TaskStatus.STATUS_SUCCESS;
    }
}
